FROM 192.168.11.101:9999/library/node:18.20.2-alpine as node18
ENV LANG C.UTF-8
RUN mkdir -p /opt/build/ai-web
COPY ./ /opt/build/ai-web

WORKDIR /opt/build/ai-web

RUN npm config set registry http://192.168.11.101:8081/repository/npm-public/ && \
    npm install -g pnpm && \
    pnpm install && pnpm run build:prod

FROM 192.168.11.101:9999/library/nginx:1.21

COPY --from=node18 /opt/build/ai-web/dist /usr/share/nginx/html
COPY --from=node18 /opt/build/ai-web/nginx.conf /usr/share/nginx/nginx.conf

WORKDIR /usr/share/nginx/html

#ENTRYPOINT ["/docker-entrypoint.sh"]

EXPOSE 80

#CMD ["nginx", "-g", "daemon off;"]